#include <Math/Randoom.h>
#include <RenderSubsystem/cvIPrimitives.h>
#include <cstdlib>
#include <cmath>

namespace cvMath
{

// [lower, higher]
float Rand(float lower, float higher)
{
	return (float(rand()) / (float)RAND_MAX) * fabs(higher-lower) + lower;
}

// [0.0, 1.0]
float RandFloat()
{
	return (float(rand()) / (float)RAND_MAX);
}

// [lower, higher]
int Rand(int lower, int higher)
{
	return rand() % abs(higher - lower) + lower;
}

// [0, range]
int Rand(int range)
{
	return rand() % (range++);
}

// Random color
RGBAf RandRGBAf()
{
	return RGBAf(RandFloat(), RandFloat(), RandFloat(), RandFloat());
}


};
